let modal_tips_ele = document.querySelector('#modal_tips');
// 弹窗关闭
modal_tips_ele.addEventListener('click', () => {
    modal_tips_ele.classList.remove('showModal')
})
let curEnv=isWxOrAli();
// ios下载触发
let iosBtnEle = document.querySelector('#ios_down').addEventListener('click', () => {
    if (curEnv == "wx" || curEnv == "ali" ) {
        modal_tips_ele.classList.add('showModal')
    } else {
        history.replaceState(null, document.title, 'https://apps.apple.com/cn/app/%E5%B9%BA%E4%B9%85/id1573858961');
        // window.open("") 
    }
})
// android下载触发
let androidBtnEle = document.querySelector('#android_down').addEventListener('click', () => {
    if (curEnv == "wx" || curEnv == "ali" ) {
        modal_tips_ele.classList.add('showModal')
    } else {
        // window.open("https://apps.apple.com/cn/app/%E5%B9%BA%E4%B9%85/id1573858961") 
    }
})
function isWxOrAli(){ 
    var ua = window.navigator.userAgent.toLowerCase();
    //判断是不是微信
    if (ua.match(/MicroMessenger/i) == "micromessenger") {
        // alert('在微信里');
        return "wx";
    }
    //判断是不是支付宝
    if (ua.match(/AlipayClient/i) == "alipayclient") {
        // alert('在支付宝里');
        return "ali";
    }
}